package com.csun.cmny.provider.dao;

import com.csun.cmny.provider.dto.ExpenseCtrItemQueryDto;
import com.csun.cmny.provider.dto.ShowAllItemDto;
import com.csun.cmny.provider.pojo.ExpCtrItem;
import com.csun.cmny.provider.vo.ExpenseCtrItemVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface ExpCtrItemMapper {
    int deleteByPrimaryKey(Integer itemId);

    int insert(ExpCtrItem record);

    int insertSelective(ExpCtrItem record);

    ExpCtrItem selectByPrimaryKey(Integer itemId);

    int updateByPrimaryKeySelective(ExpCtrItem record);

    int updateByPrimaryKey(ExpCtrItem record);
    /**
     * 根据ExpCtrItem（id、itemName）查询ExpCtrItem
     * author:liqian
     * date:2018-11-07 14:21
     */
    ExpCtrItem selectByExpCtrItem(ExpCtrItem expCtrItem);
    /**
     * 根据项目id批量修改isDelete值自动加一
     * author:liqian
     * date:2018-11-09 16:43
     */
    int updateBatch(List<ExpCtrItem> expCtrItemList);
    /**
     * 根据项目id批量修改isDelete值自动减一
     * author:liqian
     * date:2018-11-09 17:15
     */
    int updateBatchSub(List<ExpCtrItem> expCtrItemList);

    List<ExpCtrItem> setlectItemByExpensectrType(Map<String,Object> query);

    List<Map<String,Object>> showAll(ShowAllItemDto showAllItemDto);

    /**
     * query item list with page
     *
     * @param expenseCtrItemQueryDto    expense ctr item query dto
     *
     * @return  the list.
     */
    List<ExpenseCtrItemVo> queryItemListWithPage(ExpenseCtrItemQueryDto expenseCtrItemQueryDto);

    /**
     * select oldman item count by item id
     *
     * @param itemId    item id
     *
     * @return  the int.
     */
    int selectOldmanItemCountByItemId(Integer itemId);

    /**
     * select set meal item count by item id
     *
     * @param itemId    item id
     *
     * @return  the int.
     */
    int selectSetMealItemCountByItemId(Integer itemId);

    /**
     * @description: TODO  判断服务项目是否被入院，待缴费，待评估状态的老人使用
     * @param: itemId 服务项目ID groupId 机构ID
     * @return:
     * @throws 
     * @author huangxm
     * @date 2019/3/11 14:42 
     */
    List<Map<String,Object>> isItemBeUsed(@Param(value = "itemId")Integer itemId,@Param(value = "groupId")Integer groupId);

    Integer newIsItemBeUsed(@Param("itemId")Integer itemId);
}